Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

apk: Embed configurable assets in asset/ directory #122

Merged
merged 1 commit into from
Aug 22, 2023

Conversation

MarijnS95
Copy link
Member

@MarijnS95 MarijnS95 commented Jul 21, 2023

Fixes #82

Android apps might want to ship with extra files - assets - to complement the native build. These could be single files or folders that are included recursively. the file_name() of the given path is added directly to the assets/ directory, and any directory structure beyond that point is maintained.

Assets are specified in the following way in manifest.yaml:

android:
  assets:
    - some/path
    - { path: some/path } # Same as above
    - { path: some/path, optional: true } # Do not error if this  path doesn't exist
    - { path: some/path, alignment: 4096 } # Page-aligned for optimal use with AASSET_MODE_BUFFER and AAsset_getBuffer
    - { path: some/path, alignment: unaligned }
    - { path: some/path, alignment: compressed }

Android apps might want to ship with extra files - assets - to
complement the native build.  These could be single files or folders
that are included recursively.  the `file_name()` of the given path is
added directly to the `assets/` directory, and any directory structure
beyond that point is maintained.

Assets are specified in the following way in `manifest.yaml`:

    android:
      assets:
        - some/path
        - { path: some/path } # Same as above
        - { path: some/path, optional: true } # Do not error if this  path doesn't exist
        - { path: some/path, alignment: 4096 } # Page-aligned for optimal use with AASSET_MODE_BUFFER and AAsset_getBuffer
        - { path: some/path, alignment: unaligned }
        - { path: some/path, alignment: compressed }
@MarijnS95 MarijnS95 merged commit 165e3c0 into rust-mobile:master Aug 22, 2023
34 checks passed
@MarijnS95 MarijnS95 deleted the assets branch August 22, 2023 21:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Embed assets in Android APKs
2 participants